package com.ruoyi.common.core.enums;

/**
 * 业务线枚举
 */
public enum BizLine {
    BAC("基础应用中心(BAC)","Basic Application Center", true),
    CBI("跨境进口(CBI)","Cross Border Import", true),
    CBEC("跨境出口(CBEC)","Cross Border Export", true),
    FPA("金融代采(FPA)","Financial Purchasing Agent", true),
    SCF("供应链金融(SCF)","Supply Chain Finance", false),
    DC("数据中心(DC)","Data Center", false),
    SEC("结算中心(SEC)","Settlement Center", true),
    O2O("美亚Mall(O2O)","Online To Offline", true),
    ;

    /**
     * 名称中文
     */
    public final String nameCn;

    /**
     * 名称英文
     */
    public final String nameEn;

    /**
     * 是否启用
     */
    public final boolean valid;


    BizLine(String nameCn, String nameEn, boolean valid) {
        this.nameCn = nameCn;
        this.nameEn = nameEn;
        this.valid = valid;
    }

    /**
     * 获取BizCode 业务线编码
     */
    public String code(){
        return this.name();
    }

    public static BizLine parseByName(String name) {
        for (BizLine item : BizLine.values()) {
            if (item.name().equals(name)) {
                return item;
            }
        }
        return null;
    }
}
